import axios from 'axios';

let base = 'http://127.0.0.1:8000';
//注册用户
export const Register = params => { return axios.post(`${base}/res6/`, params).then(res => res.data); };
export const Register2 = params => { return axios.post(`${base}/emailreserve1/`, params).then(res => res.data); };
//登陆
export const Login = params => { return axios.post(`${base}/login2/`, params).then(res => res.data); };

//发送uid
export const Senduid = params => { return axios.post(`${base}/senduid/`, params).then(res => res.data); };

//发送gitbook
export const Gitbook = params => { return axios.post(`${base}/sadmin/Gitbook/`, params).then(res => res.data); };

//课程订单表
export const orderCourse = params => { return axios.post(`${base}/orderCourse/`, params).then(res => res.data); };

//获取优惠卷
export const getMyCoupon = params => { return axios.post(`${base}/userCoupons/`, params).then(res => res.data); };

//获取会员价格
export const getMemberPrice = params => { return axios.post(`${base}/getMemberPrice/`, params).then(res => res.data); };


//购买会员
export const buyMembers = params => { return axios.post(`${base}/memberorder/`, params).then(res => res.data); };


//支付宝支付接口
export const getpayurl = params => { return axios.post(`${base}/getpayurl/`, params).then(res => res.data); };

//验证邀请码
export const InvitationCode = params => { return axios.post(`${base}/InvitationCode/`, params).then(res => res.data); };

//获取该课程下我的优惠卷
export const getCoupon = params => { return axios.post(`${base}/access_coupon/`, params).then(res => res.data); };

//获取用户个人信息
export const getuserinfo = params => { return axios.post(`${base}/userlist/`, params).then(res => res.data); };

//获取积分兑换规则
export const showRule = params => { return axios.get(`${base}/sadmin/showRule/`, { params: params }); };
//获取课程价格
export const showprice = params => { return axios.post(`${base}/showprice/`, params).then(res => res.data);};


//购买课程

export const buyCllass = params => { return axios.post(`${base}/buycllass/`, params).then(res => res.data);};

